package com.weimob.mcloud.wechatwork.customer.service.user.constant;

/**
 * @author yuanyuan.liu
 * @create 2021/1/16 18:48
 */
public class RedisKeyConstant {

    /**
     * 手动触发外部联系人key
     */
    public static String MANUAL_SYNC_EXTERNALUSER_KEY = "corp:lock:manualsyncexternaluser:%s";

    /**
     * 自动触发外部联系人key
     */
    public static String AUTO_SYNC_EXTERNALUSER_KEY = "corp:lock:autosyncexternaluser:%s";

    /**
     * redis 锁
     */
    public static final String ADD_CORP_USER_EXTERNAL_USER_LOCK = "corp:lock:addcustomer:%s_%s_%s_%s";

    /**
     * redis 锁
     */
    public static final String ADD_CORP_USER_EXTERNAL_USER_CONSUMER_LOCK = "corp:lock:addcustomer:consumer:%s_%s_%s_%s_%s_%s";

    /**
     * redis 锁
     */
    public static final String CUSTOMER_SEARCH_RETRY = "corp:lock:customersearch:retry:%s_%s_%s_%s";


    /**
     * redis 锁
     */
    public static final String DEL_CORP_USER_EXTERNAL_USER_LOCK = "corp:lock:delcustomer:%s_%s_%s_%s";

    /**
     * redis 客户流失告警key
     */
    public static final String EMPLOYEE_DEL_CUSTOMER_WARN = "corp:employee:del:customer:warn";

    /**
     * redis 客户流失告警记录key
     */
    public static final String EMPLOYEE_DEL_CUSTOMER_WARN_RECORD = "corp:employee:del:customer:warn:record";

    /**
     * redis 客户流失触达信息key
     */
    public static final String EMPLOYEE_DEL_CUSTOMER_INFO = "corp:employee:del:customer:info";

    public static final String BATCH_MARK_TAG = "corp:lock:batchMarkTag:retry:%s_%s";

    /**
     * 防止客户打阶段并发
     */
    public static final String CUSTOMER_PROCESS_OPERATION = "corp:lock:process:stage";


    /**
     * 添加好友事件事件时间
     */
    public static final String ADD_CORP_USER_EXTERNAL_USER_CREATE_TIME = "corp:lock:add:customer:create_time:%s_%s_%s_%s";

    /**
     * 手动触发外部联系人key
     *
     * @return
     */
    public static String getManualSyncExternaluserKey(String corpid) {
        return String.format(MANUAL_SYNC_EXTERNALUSER_KEY, corpid);
    }

    /**
     * 手动触发外部联系人key
     *
     * @return
     */
    public static String getAutoSyncExternaluserKey(String corpid) {
        return String.format(AUTO_SYNC_EXTERNALUSER_KEY, corpid);
    }

    /**
     * 客户群针对于新增/移除坐席 间隔锁 12h小时内只处理一次
     */
    public static final String GROUP_PROCESS_SEAT_INTERVAL_LOCK = "group:process:seat:interval:%s_%s";


    /**
     * 客户针对于坐席/授权范围变更-客户wid推送客搜幂等锁 key
     */
    public static final String CUSTOMER_SEARCH_SEAT_INTERVAL_LOCK = "customer:search:wid:notice:interval:%s_%s_%s";
}
